'''
Created on Jan 8, 2011

@author: dexen
'''

import os
import random

import common

GEN_SIZE = 4
MUTATION_PROB = 1/float(GEN_SIZE*4.0)
#INITIALISATION 
#function for generating genotype
def random_genotype(size):
    genotype = []
    for _ in range(size):
        random.seed()
        genotype.append(random.random())
    return genotype

#houdini geometry
def develop(genotype, basefilepath, filename):
    common.enableHouModule()
    print "after enableHouModule"
    import hou
    print "after import hou"
    basefile = os.path.join(basefilepath, filename)
    print "after basefile", basefile
    hou.hipFile.load(basefile)
    print "after hipFile.load"

    

def main():
    results = ""
    for _ in range(5):
        genotype = random_genotype(GEN_SIZE)
        print "Before develop"
        develop(genotype, common.HOUDINI_BASE_FILE, "test.hipnc")
        print "After develop"


if __name__ == "__main__":
    main()